package leetcode20211004;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LUYAO
 * Date: 2021-10-04
 * Time: 9:38
 */
public class Fibonacci {
}

class Solution1 {
    public int fib(int n) {
        int a = 0;
        int b = 1;
        int sum;
        for (int i = 0; i < n; i++) {
            sum = (a+b)%1000000007;
            a = b;
            b = sum;

        }

        return  a;

    }


}
